2 '------------------------------------------------------------------------------
4 ' This code was generated from a template.
6 ' Manual changes to this file may cause unexpected behavior in your application.
7 ' Manual changes to this file will be overwritten if the code is regenerated.
9 '------------------------------------------------------------------------------
12 Imports System
.Data
.Objects
13 Imports System
.Data
.Objects
.DataClasses
14 Imports System
.Data
.EntityClient
15 Imports System
.ComponentModel
16 Imports System
.Xml
.Serialization
17 Imports System
.Runtime
.Serialization
19 <Assembly
: EdmSchemaAttribute("38eede33-590f-437d-997f-344016fd7bd4")>
20 #Region
"EDM Relationship Metadata"
21 <Assembly
: EdmRelationshipAttribute("LazyLoadingModel", "FK_Course_Department", "Department", System
.Data
.Metadata
.Edm
.RelationshipMultiplicity
.ZeroOrOne
, GetType(Department
), "Course", System
.Data
.Metadata
.Edm
.RelationshipMultiplicity
.Many
, GetType(Course
), True)>
28 ''' No Metadata Documentation available.
30 Public Partial Class LazyLoadingEntities
31 Inherits ObjectContext
33 #Region
"Constructors"
36 ''' Initializes a new LazyLoadingEntities object using the connection string found in the 'LazyLoadingEntities' section of the application configuration file.
39 MyBase
.New("name=LazyLoadingEntities", "LazyLoadingEntities")
40 MyBase
.ContextOptions
.LazyLoadingEnabled
= true
45 ''' Initialize a new LazyLoadingEntities object.
47 Public Sub New(ByVal connectionString
As String)
48 MyBase
.New(connectionString
, "LazyLoadingEntities")
49 MyBase
.ContextOptions
.LazyLoadingEnabled
= true
54 ''' Initialize a new LazyLoadingEntities object.
56 Public Sub New(ByVal connection
As EntityConnection
)
57 MyBase
.New(connection
, "LazyLoadingEntities")
58 MyBase
.ContextOptions
.LazyLoadingEnabled
= true
64 #Region
"Partial Methods"
66 Partial
Private Sub OnContextCreated()
71 #Region
"ObjectSet Properties"
74 ''' No Metadata Documentation available.
76 Public ReadOnly
Property Courses() As ObjectSet(Of Course
)
78 If (_Courses Is
Nothing) Then
79 _Courses
= MyBase
.CreateObjectSet(Of Course
)("Courses")
85 Private _Courses
As ObjectSet(Of Course
)
88 ''' No Metadata Documentation available.
90 Public ReadOnly
Property Departments() As ObjectSet(Of Department
)
92 If (_Departments Is
Nothing) Then
93 _Departments
= MyBase
.CreateObjectSet(Of Department
)("Departments")
99 Private _Departments
As ObjectSet(Of Department
)
102 #Region
"AddTo Methods"
105 ''' Deprecated Method for adding a new object to the Courses EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
107 Public Sub AddToCourses(ByVal course
As Course
)
108 MyBase
.AddObject("Courses", course
)
112 ''' Deprecated Method for adding a new object to the Departments EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
114 Public Sub AddToDepartments(ByVal department
As Department
)
115 MyBase
.AddObject("Departments", department
)
125 ''' No Metadata Documentation available.
127 <EdmEntityTypeAttribute(NamespaceName
:="LazyLoadingModel", Name
:="Course")>
129 <DataContractAttribute(IsReference
:=True)>
130 Public Partial Class Course
131 Inherits EntityObject
132 #Region
"Factory Method"
135 ''' Create a new Course object.
137 ''' <param name="courseID">Initial value of the CourseID property.</param>
138 Public Shared
Function CreateCourse(courseID
As Global.System
.Int32
) As Course
139 Dim course
as Course
= New Course
140 course
.CourseID
= courseID
145 #Region
"Primitive Properties"
148 ''' No Metadata Documentation available.
150 <EdmScalarPropertyAttribute(EntityKeyProperty
:=true, IsNullable
:=false)>
151 <DataMemberAttribute()>
152 Public Property CourseID() As Global.System
.Int32
157 If (_CourseID
<> Value
) Then
158 OnCourseIDChanging(value
)
159 ReportPropertyChanging("CourseID")
160 _CourseID
= StructuralObject
.SetValidValue(value
)
161 ReportPropertyChanged("CourseID")
167 Private _CourseID
As Global.System
.Int32
168 Private Partial
Sub OnCourseIDChanging(value
As Global.System
.Int32
)
171 Private Partial
Sub OnCourseIDChanged()
175 ''' No Metadata Documentation available.
177 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
178 <DataMemberAttribute()>
179 Public Property Title() As Global.System
.String
184 OnTitleChanging(value
)
185 ReportPropertyChanging("Title")
186 _Title
= StructuralObject
.SetValidValue(value
, true)
187 ReportPropertyChanged("Title")
192 Private _Title
As Global.System
.String
193 Private Partial
Sub OnTitleChanging(value
As Global.System
.String)
196 Private Partial
Sub OnTitleChanged()
200 ''' No Metadata Documentation available.
202 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
203 <DataMemberAttribute()>
204 Public Property Credits() As Nullable(Of
Global.System
.Int32
)
209 OnCreditsChanging(value
)
210 ReportPropertyChanging("Credits")
211 _Credits
= StructuralObject
.SetValidValue(value
)
212 ReportPropertyChanged("Credits")
217 Private _Credits
As Nullable(Of
Global.System
.Int32
)
218 Private Partial
Sub OnCreditsChanging(value
As Nullable(Of
Global.System
.Int32
))
221 Private Partial
Sub OnCreditsChanged()
225 ''' No Metadata Documentation available.
227 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
228 <DataMemberAttribute()>
229 Public Property DepartmentID() As Nullable(Of
Global.System
.Int32
)
234 OnDepartmentIDChanging(value
)
235 ReportPropertyChanging("DepartmentID")
236 _DepartmentID
= StructuralObject
.SetValidValue(value
)
237 ReportPropertyChanged("DepartmentID")
238 OnDepartmentIDChanged()
242 Private _DepartmentID
As Nullable(Of
Global.System
.Int32
)
243 Private Partial
Sub OnDepartmentIDChanging(value
As Nullable(Of
Global.System
.Int32
))
246 Private Partial
Sub OnDepartmentIDChanged()
250 ''' No Metadata Documentation available.
252 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
253 <DataMemberAttribute()>
254 Public Property StatusID() As Nullable(Of
Global.System
.Boolean)
259 OnStatusIDChanging(value
)
260 ReportPropertyChanging("StatusID")
261 _StatusID
= StructuralObject
.SetValidValue(value
)
262 ReportPropertyChanged("StatusID")
267 Private _StatusID
As Nullable(Of
Global.System
.Boolean)
268 Private Partial
Sub OnStatusIDChanging(value
As Nullable(Of
Global.System
.Boolean))
271 Private Partial
Sub OnStatusIDChanged()
275 #Region
"Navigation Properties"
278 ''' No Metadata Documentation available.
280 <XmlIgnoreAttribute()>
281 <SoapIgnoreAttribute()>
282 <DataMemberAttribute()>
283 <EdmRelationshipNavigationPropertyAttribute("LazyLoadingModel", "FK_Course_Department", "Department")>
284 Public Property Department() As Department
286 Return CType(Me, IEntityWithRelationships
).RelationshipManager
.GetRelatedReference(Of Department
)("LazyLoadingModel.FK_Course_Department", "Department").Value
289 CType(Me, IEntityWithRelationships
).RelationshipManager
.GetRelatedReference(Of Department
)("LazyLoadingModel.FK_Course_Department", "Department").Value
= value
293 ''' No Metadata Documentation available.
295 <BrowsableAttribute(False)>
296 <DataMemberAttribute()>
297 Public Property DepartmentReference() As EntityReference(Of Department
)
299 Return CType(Me, IEntityWithRelationships
).RelationshipManager
.GetRelatedReference(Of Department
)("LazyLoadingModel.FK_Course_Department", "Department")
302 If (Not value Is
Nothing)
303 CType(Me, IEntityWithRelationships
).RelationshipManager
.InitializeRelatedReference(Of Department
)("LazyLoadingModel.FK_Course_Department", "Department", value
)
312 ''' No Metadata Documentation available.
314 <EdmEntityTypeAttribute(NamespaceName
:="LazyLoadingModel", Name
:="Department")>
316 <DataContractAttribute(IsReference
:=True)>
317 Public Partial Class Department
318 Inherits EntityObject
319 #Region
"Factory Method"
322 ''' Create a new Department object.
324 ''' <param name="departmentID">Initial value of the DepartmentID property.</param>
325 Public Shared
Function CreateDepartment(departmentID
As Global.System
.Int32
) As Department
326 Dim department
as Department
= New Department
327 department
.DepartmentID
= departmentID
332 #Region
"Primitive Properties"
335 ''' No Metadata Documentation available.
337 <EdmScalarPropertyAttribute(EntityKeyProperty
:=true, IsNullable
:=false)>
338 <DataMemberAttribute()>
339 Public Property DepartmentID() As Global.System
.Int32
344 If (_DepartmentID
<> Value
) Then
345 OnDepartmentIDChanging(value
)
346 ReportPropertyChanging("DepartmentID")
347 _DepartmentID
= StructuralObject
.SetValidValue(value
)
348 ReportPropertyChanged("DepartmentID")
349 OnDepartmentIDChanged()
354 Private _DepartmentID
As Global.System
.Int32
355 Private Partial
Sub OnDepartmentIDChanging(value
As Global.System
.Int32
)
358 Private Partial
Sub OnDepartmentIDChanged()
362 ''' No Metadata Documentation available.
364 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
365 <DataMemberAttribute()>
366 Public Property Name() As Global.System
.String
371 OnNameChanging(value
)
372 ReportPropertyChanging("Name")
373 _Name
= StructuralObject
.SetValidValue(value
, true)
374 ReportPropertyChanged("Name")
379 Private _Name
As Global.System
.String
380 Private Partial
Sub OnNameChanging(value
As Global.System
.String)
383 Private Partial
Sub OnNameChanged()
387 ''' No Metadata Documentation available.
389 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
390 <DataMemberAttribute()>
391 Public Property Budget() As Nullable(Of
Global.System
.Decimal)
396 OnBudgetChanging(value
)
397 ReportPropertyChanging("Budget")
398 _Budget
= StructuralObject
.SetValidValue(value
)
399 ReportPropertyChanged("Budget")
404 Private _Budget
As Nullable(Of
Global.System
.Decimal)
405 Private Partial
Sub OnBudgetChanging(value
As Nullable(Of
Global.System
.Decimal))
408 Private Partial
Sub OnBudgetChanged()
412 ''' No Metadata Documentation available.
414 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
415 <DataMemberAttribute()>
416 Public Property StartDate() As Nullable(Of
Global.System
.DateTime
)
421 OnStartDateChanging(value
)
422 ReportPropertyChanging("StartDate")
423 _StartDate
= StructuralObject
.SetValidValue(value
)
424 ReportPropertyChanged("StartDate")
429 Private _StartDate
As Nullable(Of
Global.System
.DateTime
)
430 Private Partial
Sub OnStartDateChanging(value
As Nullable(Of
Global.System
.DateTime
))
433 Private Partial
Sub OnStartDateChanged()
437 ''' No Metadata Documentation available.
439 <EdmScalarPropertyAttribute(EntityKeyProperty
:=false, IsNullable
:=true)>
440 <DataMemberAttribute()>
441 Public Property Administrator() As Nullable(Of
Global.System
.Int32
)
443 Return _Administrator
446 OnAdministratorChanging(value
)
447 ReportPropertyChanging("Administrator")
448 _Administrator
= StructuralObject
.SetValidValue(value
)
449 ReportPropertyChanged("Administrator")
450 OnAdministratorChanged()
454 Private _Administrator
As Nullable(Of
Global.System
.Int32
)
455 Private Partial
Sub OnAdministratorChanging(value
As Nullable(Of
Global.System
.Int32
))
458 Private Partial
Sub OnAdministratorChanged()
462 #Region
"Navigation Properties"
465 ''' No Metadata Documentation available.
467 <XmlIgnoreAttribute()>
468 <SoapIgnoreAttribute()>
469 <DataMemberAttribute()>
470 <EdmRelationshipNavigationPropertyAttribute("LazyLoadingModel", "FK_Course_Department", "Course")>
471 Public Property Courses() As EntityCollection(Of Course
)
473 Return CType(Me,IEntityWithRelationships
).RelationshipManager
.GetRelatedCollection(Of Course
)("LazyLoadingModel.FK_Course_Department", "Course")
476 If (Not value Is
Nothing)
477 CType(Me, IEntityWithRelationships
).RelationshipManager
.InitializeRelatedCollection(Of Course
)("LazyLoadingModel.FK_Course_Department", "Course", value
)